Skip to content

AAE-28918 Fix for start process button is enabled when required widgets are read only without value#11781

Merged
dthornton-hyl merged 4 commits intodevelopfrom
fix/AAE-28918-startprocess-disabled
Apr 1, 2026
Merged

AAE-28918 Fix for start process button is enabled when required widgets are read only without value#11781
dthornton-hyl merged 4 commits intodevelopfrom
fix/AAE-28918-startprocess-disabled

Conversation

@dthornton-hyl
Copy link
Copy Markdown
Contributor

Please check if the PR fulfills these requirements

  • [ x] The commit message follows our guidelines
  • [ x] Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • [ x] Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)
https://hyland.atlassian.net/browse/AAE-28918
Start button is enable if all fields are read-only and required. Clicking Start button will return validation error from BE.

What is the new behaviour?
Start button is disable if all fields are read only and required

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • [ x] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes start-process form validation so the Start button is not enabled when all required widgets are read-only but empty (avoids backend-side required validation errors).

Changes:

  • Updates FormFieldModel.validate() to mark read-only + required + visible fields as invalid when their value is empty (even when the field type is not in the “validatable” list).
  • Adds a small helper (isValueEmpty) to detect empty values across common value shapes.
  • Expands unit tests to cover read-only required fields with/without values and hidden-field behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/core/src/lib/form/components/widgets/core/form-field.model.ts Adds read-only required empty-value validation to prevent enabling Start when required read-only fields are empty.
lib/core/src/lib/form/components/widgets/core/form-field.model.spec.ts Adds/updates tests validating the new read-only required behavior and hidden-field exemption.

@@ -187,6 +190,22 @@ export class FormFieldModel extends FormWidgetModel {
return !this.readOnly || FormFieldTypes.isValidatableType(this.type);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised we don't have a isFieldOrParentHidden check here - if it is correct/valid to check for field visibility as part of isFieldValidatable I would probably refactor things a bit, but my next question is should we only be doing the required check validation for readonly fields, or should all validation be ran?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And personal opinion (I know you didn't write this code), but I would rename this something like shouldValidate instead of isFieldValidatable

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look into it. Will convert this to a draft PR for the time being.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FormFieldTypes.isValidatableType just had one field type in it. So isFieldValidatable() was pretty much returning if a field was readOnly or not. Since want to validate either readOnly or not. Can pretty much do away with the isFieldValidatable() check.

The validator.validate() has checks to see if the field is validation is supported (so making the isFieldValidatable check not needed) and it also checks the isFieldOrParentHidden

@dthornton-hyl dthornton-hyl marked this pull request as draft March 30, 2026 18:31
@dthornton-hyl dthornton-hyl force-pushed the fix/AAE-28918-startprocess-disabled branch from 7120620 to 7f258b2 Compare March 31, 2026 15:24
@dthornton-hyl dthornton-hyl marked this pull request as ready for review March 31, 2026 15:40
@dthornton-hyl dthornton-hyl force-pushed the fix/AAE-28918-startprocess-disabled branch from 0c38506 to 133d1c8 Compare April 1, 2026 16:49
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@dthornton-hyl dthornton-hyl merged commit 7425279 into develop Apr 1, 2026
19 checks passed
@dthornton-hyl dthornton-hyl deleted the fix/AAE-28918-startprocess-disabled branch April 1, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants